﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL.Entities
{
    using System.Data.Entity;
    using System.Data.Entity.ModelConfiguration.Conventions;

    /// <summary>
    /// Cơ sở dữ liệu
    /// </summary>
    public class Context : DbContext
    {
        public DbSet<Daynha> Daynhas { get; set; }
        public DbSet<Phong> Phongs { get; set; }
        public DbSet<Khoa> Khoas { get; set; }
        public DbSet<Lophoc> Lophocs { get; set; }
        public DbSet<Doituong> Doituongs { get; set; }
        public DbSet<Sinhvien> Sinhviens { get; set; }
        public DbSet<Hopdong> Hopdongs { get; set; }
        public DbSet<Phieuthu> Phieuthus { get; set; }

        public Context() : base("KTX") { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<OneToManyCascadeDeleteConvention>();
            base.OnModelCreating(modelBuilder);
        }
    }
}